// 基础Api
import { createBrowserRouter, Navigate } from 'react-router-dom';
import Welcome from '@/views/Welcome';
import Login from '@/views/Login';
import Error404 from '@/views/Error404';

// 动态路由是指匹配路径中包含动态参数的规则。
const router = createBrowserRouter([
  {
    path: '/',
    element: <Welcome />
  },
  {
    path: '/login',
    element: <Login />
  },
  {
    path: '/404',
    element: <Error404 />
  },
  {
    path: '*',
    element: <Navigate to={'/404'} />
  }
]);

export default router;
